<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <title></title>
    <script type="text/javascript" src="EasyCrypt.js"></script>
    <script type="text/javascript" src="jquery.1.6.4.js"></script>

    <script type="text/javascript">

        /*
        var cool = 's d!!!!';
        var encrypted = EasyCrypt.encrypt(cool);
        var decrypted = EasyCrypt.decrypt(encrypted);

        console.log('Original Text :',cool);
        console.log('Encrypted Text :',encrypted);
        console.log('Original Text :',decrypted);
        */

        function encode() {
           var inp = $('#plain').val();

           if(inp.length == 0) {
              alert('Empty input dumbass!');
           }
           else {
               $('#enc').val(EasyCrypt.encrypt(inp));
           }
        }

        function clientDecode() {
           var inp = $('#enc').val();

           if(inp.length == 0) {
              alert('Empty input dumbass!');
           }
           else {
               $('#client_dec').val(EasyCrypt.decrypt(inp));
           }
        }

        function serverDecode() {
            var inp = $('#enc').val();

            if(inp.length == 0) {
               alert('Empty input dumbass!');
            }
            else {


                $.get('php/ServerDecrypter.php?cipher='+inp,
                        function(data) {
                            $('#server_dec').val(data.plaintext);
                })

            }


        }

    </script>

</head>
<body>

<br/><br/><br/><br/><br/>
    Plain Text : <input id="plain" type="text"/> <br/>
    Encrypted Text : <input id="enc" type="text"/><input type="button" onclick="encode()" value="Encode"/> <br/>
    Client Side Decrypt: <input id="client_dec" type="text"/><input type="button" onclick="clientDecode()" value="Client Decrypt"/><br/>
    Server Side Decrypt: <input id="server_dec" type="text"/><input type="button" onclick="serverDecode()" value="Server Decrypt"/><br/>
</body>
</html>